package demo.demoweb.controller;

import demo.demodao.Demo;
import demo.demoservice.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.awt.*;

/**
 * @Author: 单朋
 * @Date: create in 10:51 2019/3/13
 */
@RestController
public class DemoController {
    @Autowired
    private DemoService demoService;
    @GetMapping(value = "/add")
    public Demo addDemo() {
        Demo demo=new Demo();
        demo.setName("1234");
        demo.setAge("12");
        demo.setGender("1");
        demo.setPhone("13324245353");
        demo.setAddress("2u3190378023uhdakjsdhia");
        return demoService.addOne(demo);
    }
}
